<!DOCTYPE>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" />
	<link rel="stylesheet" href="/static/css/css/Site.css" />
	<link rel="stylesheet" href="/static/css/css/zy.all.css" />
	<link rel="stylesheet" href="/static/css/css/font-awesome.min.css" />
	<link rel="stylesheet" href="/static/css/css/amazeui.min.css" />
	<link rel="stylesheet" href="/static/css/css/admin.css" />
	<style>
	</style>
<body>
<div class="dvcontent">

	<div>
		<!--tab start-->
		<div class="tabs">
			<div class="hd">
				<ul style="">
					<li style="box-sizing: initial;-webkit-box-sizing: initial;" class="on">查看分类</li>
					<li class="" style="box-sizing: initial;-webkit-box-sizing: initial;">添加分类</li>
				</ul>
			</div>
			<div class="bd">
				<ul style="display: block;padding: 20px;">
					<li>
						<!--分页显示角色信息 start-->
						<div id="dv1">
							<table class="table" id="tbRecord">
								<thead>
								<tr>
									<th>分类编号</th>
									<th>分类名称</th>
									<th>分类描述</th>
									<th>备注</th>
									<th>编辑</th>
									<th>删除</th>
								</tr>
								</thead>
								<tbody>
								<tr  th:each="emp:${diet_vegetables}">
									<td th:text="${emp.getIficationid()}"></td>
									<td th:text="${emp.getIficationname()}"></td>
									<td> </td>
									<td> </td>
									<td class="edit"><a th:href="@{/vegetables/vegetabupdate(id=${emp.getIficationid()})}"><button><i class="icon-edit bigger-120"></i>编辑</button></a></td>
									<td class="delete"><a  th:href="@{/vegetables/DeleteRawMaterialsType(ificationid=${emp.getIficationid()})}"><button class="delot"><i class="icon-trash bigger-120"></i>删除</button></a></td>
								</tr>
								</tbody>
							</table>
						</div>
						<!--分页显示角色信息 end-->
					</li>
				</ul>
				<ul class="theme-popbod dform" style="display: none;">
					<div class="am-cf admin-main" style="padding-top: 0px;">
						<!-- content start -->

						<div class="am-cf admin-main" style="padding-top: 0px;">
							<!-- content start -->
							<div class="admin-content">
								<div class="admin-content-body">

									<div class="am-g">
										<div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">

										</div>
										<div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4"
											 style="padding-top: 30px;">
											<form class="am-form am-form-horizontal" method="post">

												<form class="am-form am-form-horizontal"
													  action="/vegetables/VegetablesGetAll" method="post">
													<div class="am-form-group">
														<label for="user-name" class="am-u-sm-3 am-form-label">
															分类编号</label>
														<div class="am-u-sm-9">
															<input type="text" id="user-name" required
																   placeholder="分类名称" name="name">
															<small>10字以内...</small>
														</div>
													</div>
													<div class="am-form-group">
														<label for="user-intro" class="am-u-sm-3 am-form-label">
															分类名称</label>
														<div class="am-u-sm-9">
									<textarea class="" rows="5" id="user-intro" name="remark"
											  placeholder="输入备注"></textarea>
															<small>250字以内...</small>
														</div>
													</div>
													<div class="am-form-group">
														<div class="am-u-sm-9 am-u-sm-push-3">
															<input id="cungro" type="submit" class="am-btn am-btn-success" value="添加分类" />
														</div>
													</div>
												</form>
										</div>
									</div>
								</div>

							</div>
							<!-- content end -->
						</div>
						<!-- end-->
				</ul>
			</div>
		</div>
		<!--tab end-->

	</div>


	<script src="/static/css/js/jquery-1.7.2.min.js" type="text/javascript"></script>
	<script src="/static/css/js/plugs/Jqueryplugs.js" type="text/javascript"></script>
	<script src="/static/css/js/_layout.js"></script>
	<script src="/static/css/js/plugs/jquery.SuperSlide.source.js"></script>
	<script>
		var num = 1;
		$(function() {

			$(".tabs").slide({ trigger: "click" });

		});
		$('#cungro').click(function () {
			var name =$("#user-name").val();

			var intro=$("#user-intro").val();

			$.ajax({
				type: "post",
				url: "/vegetables/AddRawMaterialsType",
				data: { "ificationid": name,"ificationname": intro},
				dataType:"JSON",
				success: function(data) {
					if(data > 0) {
						alert("添加成功")
					}else{
						alert("添加失败")
					}
				}
			});
		});

		$('.delot').click(function () {
			var delnt = confirm("你确定要删除吗?");
			if (delnt==false){
				return false;
			}
			return true;
		});
	</script>

</div>
</body>

</html>